package com.tang.service.account.domain;

import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tang.common.enums.UserStatus;
import com.tang.common.utils.excel.annotation.ExcelEnum;
import com.tang.common.utils.excel.converter.EnumConverter;
import com.tang.common.utils.excel.converter.LocalDateTimeConverter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import com.tang.framework.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;


@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "基本用户表")
@TableName(value = "base_user")
public class BaseUser extends BaseEntity<BaseUser>{


    @Schema(description = "用户昵称")
    @ExcelIgnore
    @TableField(value = "String")
    private String nickName;


    @Schema(description = "手机号")
    @ExcelProperty(value = "手机号")
    @TableField(value = "String")
    private String phone;


    @Schema(description = "注册时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "注册时间", converter = LocalDateTimeConverter.class)
    @TableField(value = "register_time")
    private LocalDateTime registerTime;


    @Schema(description = "用户余额")
    @ExcelProperty(value = "用户余额")
    @TableField(value = "balance")
    private BigDecimal balance;


    @Schema(description = "用户状态", ref = "com.tang.common.enums.UserStatus")
    @ExcelProperty(value = "用户状态", converter = EnumConverter.class)
    @ExcelEnum
    @TableField(value = "user_status")
    private UserStatus userStatus;

}
